Conversation
|
JoshSanch
left a comment
There was a problem hiding this comment.
Great work overall! Lots of small things here that I wanted to call your attention to so excuse the overly short review comments by the end.
src/SB/Game/zMain.cpp
Outdated
| void zMainShowProgressBar() | ||
| { | ||
| S32 progBar; | ||
| size_t sVar2; |
There was a problem hiding this comment.
Please give sVar2 a semantically appropriate name based on its usage.
src/SB/Game/zMain.cpp
Outdated
| xUtil_idtag2string(0x464f4e54, 0); | ||
| iTimeDiffSec(time); | ||
| xSTPreLoadScene(0x464f4e54, NULL, 0x1); | ||
| time = iTimeGet(); | ||
| xUtil_idtag2string(0x464f4e54, 0); | ||
| iTimeDiffSec(time); | ||
| xSTQueueSceneAssets(0x464f4e54, 1); | ||
| time = iTimeGet(); | ||
| xUtil_idtag2string(0x464f4e54, 0); | ||
| iTimeDiffSec(time); |
There was a problem hiding this comment.
Please replace usages of 0x464f4e54 with the char literal representation 'FONT', which is more readable and more likely to be what Heavy Iron used here.
src/SB/Game/zMain.cpp
Outdated
| xSTDisconnect(0x464f4e54, 1); | ||
| time = iTimeGet(); | ||
| xUtil_idtag2string(0x464f4e54, 0); | ||
| iTimeDiffSec(time); |
There was a problem hiding this comment.
Please additionally address these usages of 0x464f4e54.
src/SB/Game/zMain.cpp
Outdated
| xSTPreLoadScene(0x504c4154, 0, 1); | ||
| xSTQueueSceneAssets(0x504c4154, 1); |
There was a problem hiding this comment.
This is equivalent to 'PLAT'.
| xSTDisconnect(0x504c4154, 1); | ||
| zMainShowProgressBar(); | ||
| iTimeGet(); | ||
| xShadowSimple_Init(); | ||
| globals.pickupTable = (zAssetPickupTable*)xSTFindAssetByType(0x5049434b, 0, 0); | ||
| // globals.pickupTable = zPickupTableInit(); | ||
| // zPickupTableInit hasnt been implemented yet | ||
| xMemPushBase(); | ||
| time = iTimeGet(); | ||
| xUtil_idtag2string(0x4d4e5534, 0); | ||
| iTimeDiffSec(time); | ||
| xSTPreLoadScene(0x4d4e5534, 0, 1); | ||
| time = iTimeGet(); | ||
| xUtil_idtag2string(0x4d4e5534, 0); | ||
| iTimeDiffSec(time); | ||
| xSTQueueSceneAssets(0x4d4e5534, 1); | ||
| time = iTimeGet(); | ||
| xUtil_idtag2string(0x4d4e5534, 0); | ||
| iTimeDiffSec(time); | ||
| do | ||
| { | ||
| xSTLoadStep(time); | ||
| } while (time < 1.0f); | ||
| xSTDisconnect(0x4d4e5534, 1); | ||
| zMainShowProgressBar(); | ||
| time = iTimeGet(); | ||
| xUtil_idtag2string(0x4d4e5534, 0); | ||
| iTimeDiffSec(time); | ||
| xMemPushBase(); | ||
| time = iTimeGet(); | ||
| xUtil_idtag2string(0x4d4e5535, 0); | ||
| iTimeDiffSec(time); | ||
| xSTPreLoadScene(0x4d4e5535, 0, 1); | ||
| time = iTimeGet(); | ||
| xUtil_idtag2string(0x4d4e5535, 0); | ||
| iTimeDiffSec(time); | ||
| xSTQueueSceneAssets(0x4d4e5535, 1); | ||
| time = iTimeGet(); | ||
| xUtil_idtag2string(0x4d4e5535, 0); | ||
| iTimeDiffSec(time); | ||
| do | ||
| { | ||
| xSTLoadStep(time); | ||
| } while (time < 1.0f); | ||
| xSTDisconnect(0x4d4e5535, 1); | ||
| zMainShowProgressBar(); | ||
| time = iTimeGet(); | ||
| xUtil_idtag2string(0x4d4e5535, 0); | ||
| iTimeDiffSec(time); | ||
| xModelInit(); | ||
| xModelPoolInit(0x20, 0x40); | ||
| xModelPoolInit(0x28, 8); | ||
| xModelPoolInit(0x38, 1); |
There was a problem hiding this comment.
Make sure that any integer that can be better expressed by a char literal (e.g 'PLAT', 'FONT') is substituted with that char literal here.
src/SB/Game/zMain.cpp
Outdated
| cam = iCameraCreate(0x280, 0x1e0, 0); | ||
| RwCameraClear(cam, colour, clearMode); | ||
| RwCameraBeginUpdate(cam); | ||
| render_mem_card_no_space(needed, available, neededFiles, unk0); | ||
| RwCameraEndUpdate(cam); | ||
| RwCameraShowRaster(cam, 0, 1); | ||
| iCameraDestroy(cam); | ||
| } | ||
|
|
||
| void zMainMemCardRenderText(const char* a, bool enabled) | ||
| { | ||
| RwCamera* cam = 0; | ||
| RwRGBA* colour = 0; | ||
| RwInt32 clearMode = 3; | ||
|
|
||
| cam = iCameraCreate(0x280, 0x1e0, 0); | ||
| RwCameraClear(cam, colour, clearMode); | ||
| RwCameraBeginUpdate(cam); |
There was a problem hiding this comment.
These are meant to specify the screen dimensions 640 x 480 - please replace the hex values with their integer equivalents.
src/SB/Game/zMain.cpp
Outdated
| RwCameraBeginUpdate(cam); | ||
| RenderText(a, enabled); | ||
| RwCameraEndUpdate(cam); | ||
| RwCameraShowRaster(cam, 0, 1); |
There was a problem hiding this comment.
Are either of these integers better represented using TRUE/FALSE?
src/SB/Game/zMain.cpp
Outdated
| xUtil_idtag2string(0x464f4e54, 0); | ||
| iTimeDiffSec(time); | ||
| xSTPreLoadScene(0x464f4e54, NULL, 0x1); | ||
| time = iTimeGet(); | ||
| xUtil_idtag2string(0x464f4e54, 0); | ||
| iTimeDiffSec(time); | ||
| xSTQueueSceneAssets(0x464f4e54, 1); | ||
| time = iTimeGet(); | ||
| xUtil_idtag2string(0x464f4e54, 0); |
There was a problem hiding this comment.
Please substitute char literals here as well
src/SB/Game/zMain.cpp
Outdated
| xSTDisconnect(0x464f4e54, 1); | ||
| time = iTimeGet(); | ||
| xUtil_idtag2string(0x464f4e54, 0); |
🆗 ✅+1538 bytes No Regressions 🎉Progress: 8📈 |
🆗 ✅+1594 bytes No Regressions 🎉Progress: 8📈 |
JoshSanch
left a comment
There was a problem hiding this comment.
Nearly there, some straggling ints that should have char literal substitutions.
🆗 ✅+1586 bytes No Regressions 🎉Progress: 8📈 |
JoshSanch
left a comment
There was a problem hiding this comment.
Looks good to me, good work!
Cleanup and function implementations on zMain